<!DOCTYPE html>
<html lang="en" >

<script>
    //320 100   3.2
    //375 117   3.2
    window.onload  = function(){
     var rate = 3.2;
     var wh = document.body.clientWidth||document.documentElement.clientWidth;
     document.documentElement.style.fontSize = wh/rate+"px";
    }
</script>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, shrink-to-fit=no, viewport-fit=cover">
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        *{
            margin:0px;
            padding:0px;
        }


        img{
            vertical-align: middle;
        }
        /*
        媒介查询
       给不同宽度设备设置不同的字体大小
         */
        @media screen and (max-width:321px){
            body{font-size:14px}
        }
        @media screen and (min-width:321px) and (max-width:400px){
            body{font-size:16px}
        }
        @media screen and (min-width:400px){
            body{font-size:18px}
        }
    </style>
</head>
<body>
 <div id="all" style="width:3.2rem;height:5.68rem;background:red;">hello

     <div style="width:3rem;background:yellow;margin:0 auto"> hello
         <img src="https://www.baidu.com/img/bd_logo1.png?where=super" style="width:100%" />
     </div>
 </div>
</body>
</html>